/*
 * @Author: dingyuwen ding_yuwen@163.com
 * @Date: 2023-02-08 18:44:06
 * @LastEditTime: 2023-04-12 18:39:47
 * @LastEditors: DingYuwen 43669762+DingYuwen@users.noreply.github.com
 * @Description:
 */

import { Flex } from '@chakra-ui/react';
// import Hero from './modules/Hero';
import { loginAction } from '@/store/user';
// import { useEffect } from 'react';
import { useAppDispatch } from '@/store/hooks';
import { LoginInfo } from '@/api/user.service';
import {
  useNavigate,
} from 'react-router-dom';

function Home() {
  const dispatch = useAppDispatch();
  const navigate = useNavigate();

  async function handleLogin(values: LoginInfo) {
    try {
      await dispatch(loginAction(values));
      // navigate('/aigc')
      window.location.href="https://aigc.aigctour.com/aigc?redirect=https://aigc.aigctour.com/jinghua/aigc"
    } catch (e) {
      console.log(e);
    }
  };
  
  handleLogin({
    username: "skytex",
    password: "tourfly@321",
    rememberMe: false
  })
  
  return (
    <Flex flexDirection="column" w="full" h="full" flexGrow={1}>

    </Flex>
  );
}

export default Home;
